/**
 * 
 */

import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.PrintWriter;
import java.io.IOException;




/**
 * Class for Generating .ics files 
 * 
 * @author nisoda
 *
 */
public class GeneratingICS {

	/**
	 * Generates a simple .ics file
	 * @param args
	 */
	public static void main(String[] args) {		
		try {
			int eventCounter = 1;
			File outputICS = new File("Event" + eventCounter + ".ics");
			
			FileWriter fileWriter = new FileWriter(outputICS.getAbsoluteFile());
			BufferedWriter buffWriter = new BufferedWriter(fileWriter);
			PrintWriter printer = new PrintWriter(buffWriter);
			
			printer.println("BEGIN:VCALENDAR");
			printer.println("BEGIN:VTIMEZONE");
			printer.println("TZID:Pacific/Honolulu");
			printer.println("BEGIN:STANDARD");
			printer.println("TZOFFSETFROM:-1000");
			printer.println("TZOFFSETTO:-1000");
			printer.println("TZNAME:HST");
			printer.println("END:STANDARD");
			printer.println("END:VTIMEZONE");
			printer.println("BEGIN:VEVENT");
			printer.println("DTSTART:20140725");
			printer.println("DTEND:20140725");
			printer.println("SUMMARY:Practice event");
			printer.println("END:VEVENT");
			printer.println("END:VCALENDAR");
			
			printer.close();
		}
		catch(IOException e) {
			
		}

	}

}
